<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<!-- <script>
    //class类继承
    class Pet {
        constructor(name, age) {
            this.name = name;
            this.age = age;
        }

        origin() {
            console.log("这个方法在Pet的原型对象上")
        }

        static origin2() {
            console.log("这个方法在Pet的上")
        }
    }

    class Dog extends Pet {
        constructor(name, age) {
            super(name, age)
        }

        //开始继承

        local() {
            super.origin()
        }

        // local2() {
        //     super.origin2()
        // }

    }

    let golden = new Dog()
    golden.origin()
    // golden.origin2()
</script> -->
<!-- <script>
    //设置私有属性
    // class Dog {
    //     constructor() {}
    //     get jinmao() {
    //         return golden_1;
    //     }
    //     set jinmao(value) {
    //         golden_1 = value;
    //     }
    // }
</script> -->
<script>
    //复习promise
    //用法一
    // 1.创建Promise对象
    var promise = new Promise((resolve, reject) => {
        if (true) {
            reject(111111)
            console.log(1111111111)
        } else(
            resolve(2222222222)
        )
    })

    // 接收
    promise.then((res) => {
        console.log(res)
    })

    promise.catch((err) => {
        console.log(err)
    })

    promise.finally(() => {
        console.log("反正一定执行这个")
    })

    promise.finally(() => { //这里不传参
        console.log("不管如何都会执行这个回调函数")
    })
</script>

</html>